package com.kob.backend.controller.user;
import com.kob.backend.pojo.Bot;
import com.kob.backend.service.user.bot.BotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/user/bot/")
public class BotController {
    @Autowired
    private BotService botService;

    @PostMapping("/add/")
    public Map<String,String> addBot(@RequestParam Map<String,String> data){
        return botService.addBot(data);
    }

    @PostMapping("/delete/")
    public Map<String, String> deleteBot(@RequestParam Map<String, String> data){
        return botService.deleteBot(data);
    }
    @GetMapping("/getlist/")
    public List<Bot> getList(){
        return botService.selectBot();
    }
    @PostMapping("/update/")
    public Map<String, String> updateBot(@RequestParam Map<String, String> data){


        return botService.updateBot(data);
    }
    @GetMapping("/selectone/")
    public Bot selectOne(@RequestParam Map<String, String> data){
        return botService.selectOneBot(data);
    }
}
